package com.moss.cloud.plugins.biz.controller;

import com.moss.cloud.common.core.constant.ServiceList;
import com.moss.cloud.common.core.model.Result;
import com.moss.cloud.common.security.annotation.SysLog;
import com.moss.cloud.plugins.biz.service.IModelDefaultFieldService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 默认字段前端控制器
 *
 * @author 瑾年
 * @date 2024年1月3日
 */
@RestController
@RequestMapping(ServiceList.PLUGINS + "/modelDefaultField")
public class ModelDefaultFieldController {

    private final IModelDefaultFieldService modelDefaultFieldService;

    public ModelDefaultFieldController(IModelDefaultFieldService modelDefaultFieldService) {
        this.modelDefaultFieldService = modelDefaultFieldService;
    }


    /**
     * 查询默认字段
     *
     * @return
     */
    @PostMapping("/defaultField")
    @SysLog(serverName = ServiceList.MOSS_CLOUD_PLUGINS, operation = "查询默认字段")
    public Result<?> defaultField() {
        return Result.success(modelDefaultFieldService.defaultField());
    }
}
